/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dasha;

import java.util.Calendar;
import java.util.TimeZone;

/**
 *
 * @author Keshavaprasad B S
 */
public class DashaCalculator {

    private static long PERIOD_OF_MOON_ORBIT = ((((27 * 24 +7) * 60 +43) * 60+11)) * 1000 +500;
    private Calendar myBirthTime;

    public DashaCalculator(Calendar birthTime) {
        myBirthTime = birthTime;
    }

    public void getDasha() {
        Calendar a = Calendar.getInstance(TimeZone.getTimeZone("IST"));
        //a.set(1970, 0, 14, 17, 50);
        a.set(1970, 0, 14, 17, 50);
        long time = myBirthTime.getTime().getTime() - a.getTime().getTime();
        long rem = time % PERIOD_OF_MOON_ORBIT;
        System.out.println(rem * 27 / (PERIOD_OF_MOON_ORBIT *1.0));
    }
}
